import request from '@/utils/request'

// 查询预案列表
export function lists(query) {
  return request({
    url: '/decision/task/slist',
    method: 'get',
    params: query
  })
}

// 查询预案列表
export function listTask(query) {
  return request({
    url: '/decision/task/list',
    method: 'post',
    data: query
  })
}
// 查询预案下的策略列表
export function strategyTask(query) {
  return request({
    url: '/decision/usertaskstrategy/taskId/' + query,
    method: 'get'
  })
}

// 查询预案详细
export function getTask(taskId) {
  return request({
    url: '/decision/task/' + taskId,
    method: 'get'
  })
}

// 新增预案
export function addTask(data) {
  return request({
    url: '/decision/task',
    method: 'post',
    data: data
  })
}
// 决策预案id 与 用户id，策略id中间表
export function usertaskstrategy(data) {
  return request({
    url: '/decision/usertaskstrategy',
    method: 'post',
    data: data
  })
}

//  决策方案id 与  用户id，策略id中间表    
export function userschemestrategy(data) {
  return request({
    url: '/decision/userschemestrategy',
    method: 'post',
    data: data
  })
}
//决策方案
export function scheme(data) {
  return request({
    url: '/decision/scheme',
    method: 'post',
    data: data
  })
}

// 修改预案
export function updateTask(data) {
  return request({
    url: '/decision/task',
    method: 'put',
    data: data
  })
}

// 删除预案
export function delTask(taskId) {
  return request({
    url: '/decision/task/' + taskId,
    method: 'delete'
  })
}
